import { DateTransformer } from './../utils/dateTransformer';
import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';
import { Exclude, Expose, Transform, Type } from 'class-transformer';
import { CommonEntity } from './common.entity';

@Entity('sys_permission')
export class SysPermissionEntity {

    // 将 int 类型的id转成string类型，防止前端精度缺失
    @PrimaryGeneratedColumn({ type: 'int' })
    id: string;

    @Column({ comment: '父级菜单id', nullable: true, type: 'int' })
    pId: string;

    @Column({ comment: '菜单名称' })
    name: string;

    @Column({ comment: '类型 1：菜单 2：功能', width: 1 })
    type: string;

    @Column({ comment: 'type为功能时的行为：增、删、改、查 ' })
    action: string;

    @Column({ comment: '路由地址' })
    path: string;

    @Column({ comment: '排序', default: 0 })
    sort: number;

    @Column({ comment: '是否禁止 0：正常，1：禁止', default: '0', length: 1 })
    forbidden: string;

}      